package com.duxd.springsecurityfinal.springsecurityfinal.response;

import java.util.StringJoiner;

/**
 * @author dong
 * @date 2022/1/14 0014
 */
public class Response<T> {
    private Integer code;
    private String message;
    private T data;

    public Response(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Response setData(T data) {
        this.data = data;
        return this;
    }

    public T getData() {
        return data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", Response.class.getSimpleName() + "[", "]")
                .add("code=" + code)
                .add("message='" + message + "'")
                .add("data=" + data)
                .toString();
    }
}
